//
//  UIView+viewController.m
//  FangGeek
//
//  Created by FangGeek on 16/9/7.
//  Copyright © 2016年 FangGeek. All rights reserved.
//

#import "UIView+viewController.h"

@implementation UIView (viewController)
//判断当前在哪个控制器

- (UIViewController *)ViewController
{
    UIResponder *next = [self nextResponder];
    do {
        if ([next isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)next;
        }
        next = [next nextResponder];
    } while (next != nil);
    
    return nil;
}
@end
